#set( $symbol_pound = '#' )
#set( $symbol_dollar = '$' )
#set( $symbol_escape = '\' )
package ${package}.common.bean.po;

import ${package}.common.bean.vo.CodeTypeApiVo;
import ${package}.common.bean.vo.CodeTypeVo;
import ${package}.common.emum.CommonStatusEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * Description: CodeType 描述代码类型，准确来说，代码指代的含义
 *
 * @author wenxiaopeng
 * @date 2020/07/24 13:55
 *
 * <pre>
 *              ${copyright}
 *      Copyright (c) 2019. All Rights Reserved.
 * </pre>
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class CodeType implements Serializable {

	private static final long serialVersionUID = 1L;

	private Long id;
	/**
	 * 代码类型
	 */
	private String codeType;

	/** @see ${package}.common.emum.CodeCreateWay */
	private Integer createWay;
	/**
	 * 描述
	 */
	private String description;

	/** 状态
	 * @see ${package}.common.emum.CommonStatusEnum */
	private Integer status;

	public CodeTypeVo asVo() {
		return new CodeTypeVo(id, codeType, createWay, description, status, null);
	}

	public CodeTypeApiVo asApiVo() {
        return new CodeTypeApiVo(id, codeType, description, CommonStatusEnum.STATUS_VALID.getCode().equals(status));
	}

}
